$.ajaxPrefilter(function (options) {
    // 再发起真正的ajax请求之前统一拼接请求根路径
    options.url = 'http://ajax.frontend.itheima.net' + options.url
    if (options.url.indexOf('/my/') != -1) {
        options.headers = {
            Authorization: localStorage.getItem('token') || ''
        }
    }
    // options.complete = function (res) {
    //     console.log(res);
    //     if (res.responseJSON.status === 1 && res.responseJSON.message === "身份认证失败！") {
    //         localStorage.removeItem('token')
    //         location.href = '/login.html'
    //     }

    })